#!/bin/bash
#

##134 223 45 98 76 243 8 6 1 47冒泡排序

arry=(134 223 45 98 76 243 8 6 1 47)

for ((i=0; i<=(${#arry[@]}-1); i++));do
    for ((j=(i+1); j<=(${#arry[@]}-1); j++));do
	if [ ${arry[i]} -gt ${arry[j]} ]; then
	    tmp=${arry[i]}
	    arry[i]=${arry[j]}
	    arry[j]=$tmp
	fi
    done
done

echo ${arry[*]}

